home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Misc / InstallerNG / developer / gui / example / igui_SWING_Mode.c < prev    next >
C/C++ Source or Header  |  1999-10-31  |  2KB  |  82 lines

  1.  
  2. #include "includes.h"
  3. #include "installergui_data.h"
  4.  
  5. /********************************************************************
  6.  *
  7.  *  DESCRIPTION
  8.  *
  9.  *  when the InstallerNG evaluates a SWINF function, then it calls
  10.  *  igui_SWING_Mode(app, TRUE) if it starts to interpret the arguments
  11.  *  and calls igui_SWING_Mode(app, FALSE) when it leaves the SWING
  12.  *  function. you should note in your private application structure,
  13.  *  that you execute inside of a SWING environment, because you must
  14.  *  distinguish the execution modes, when you wait (see the igui_WaitApp
  15.  *  function.
  16.  *
  17.  *  IN:  application - pointer to the private application structure
  18.  *       mode - TRUE or FALSE, depends on whether the InstallerNG
  19.  *              enters (TRUE) or exits (FALSE) the SWING mode
  20.  *
  21.  *  OUT: the mode argument itself
  22.  *
  23.  */
  24.  
  25. /********************************************************************
  26.  *
  27.  *  STATIC
  28.  *
  29.  */
  30.  
  31. /********************************************************************
  32.  *
  33.  *  EXTERN
  34.  *
  35.  */
  36.  
  37. /********************************************************************
  38.  *
  39.  *  PUBLIC
  40.  *
  41.  */
  42.  
  43. /********************************************************************
  44.  *
  45.  *  CODE
  46.  *
  47.  */
  48.  
  49. BOOL __asm igui_SWING_Mode(register __a0 APTR application,
  50.                            register __d0 BOOL mode)
  51. {
  52.   #ifdef DEBUG
  53.   DEBUG_MAKRO
  54.   #endif
  55.  
  56.   {
  57.     struct Application *app = (struct Application *) application;
  58.  
  59.     // keep the mode
  60.     app->app_SWING_Mode = mode;
  61.  
  62.     // switch to SWING mode
  63.     if (mode)
  64.     {
  65.       igui_NameProceed(app, app->app_Texts[BUTTON_NEXTPAGE]);
  66.       igui_NameCancel(app, app->app_Texts[BUTTON_PREVPAGE]);
  67.     }
  68.  
  69.     // reset from the SWING mode
  70.     else
  71.     {
  72.       igui_NameProceed(app, (char *) app->app_GlobalEnv[GENV_PROCEED_BUTTON]);
  73.       igui_NameCancel(app, (char *) app->app_GlobalEnv[GENV_ABORT_BUTTON]);
  74.       igui_DisableCancel(app, FALSE);
  75.     }
  76.  
  77.     return (mode);
  78.   }
  79. }
  80.  
  81.  
  82.